package com.meng.mengiotmaster;

import android.app.Application;
import android.content.Context;
import android.os.Handler;

import cn.wch.ch34xuartdriver.CH34xUARTDriver;


/**
 * Create by：chenj on 2020/12/28 17:30
 * email：2355727644@qq.com
 */
public class ReallyApplication extends Application {


    private static Handler mHandler;//主线程Handler
    private static long mMainThreadId;//主线程id
    private static Thread mMainThread;//主线程
    public static CH34xUARTDriver driver;
    @Override
    public void onCreate(){
        super.onCreate();
        mMainThread = Thread.currentThread();
        mMainThreadId = android.os.Process.myTid();
        mHandler = new Handler();
    }
    /**
     * 初始化配置
     */
    private void _initConfig() {


    }
    /**
     * 得到上下文
     *
     * @return
     */
    public static Context getContext() {
        return ReallyApplication.getContext();
    }
    public static long getMainThreadId() {
        return mMainThreadId;
    }

    public static Handler getMainHandler() {
        return mHandler;
    }
}
